<html>
<head><meta charset="utf-8"><title>Convert `GenericParamDef` to source name · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Convert.20.60GenericParamDef.60.20to.20source.20name.html">Convert `GenericParamDef` to source name</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="235971982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Convert%20%60GenericParamDef%60%20to%20source%20name/near/235971982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Convert.20.60GenericParamDef.60.20to.20source.20name.html#235971982">(Apr 24 2021 at 14:01)</a>:</h4>
<p>How does one convert a <code>rustc_middle::ty::GenericParamDef</code> to its equivalent source name? I tried <code>.name</code> but that seems to be too generic, e.g. always <code>T</code> for any type.</p>



<a name="235972301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Convert%20%60GenericParamDef%60%20to%20source%20name/near/235972301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Convert.20.60GenericParamDef.60.20to.20source.20name.html#235972301">(Apr 24 2021 at 14:03)</a>:</h4>
<p>It seems I was converting the wrong thing. <span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span> But I'd still like to know how to convert a <code>GenericArg</code>.</p>



<a name="235974250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Convert%20%60GenericParamDef%60%20to%20source%20name/near/235974250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hameer Abbasi <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Convert.20.60GenericParamDef.60.20to.20source.20name.html#235974250">(Apr 24 2021 at 14:29)</a>:</h4>
<p>(See <a href="https://github.com/rust-lang/rust/issues/84520">#84520</a> for context)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>